package cn.classyex.business.hr.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.classyex.business.hr.mapper.RecruitmentMapper;
import cn.classyex.business.hr.domain.Recruitment;
import cn.classyex.business.hr.service.IRecruitmentService;
import com.ruoyi.common.core.text.Convert;

/**
 * 招聘信息管理Service业务层处理
 * 
 * @author yex
 * @date 2021-05-05
 */
@Service
public class RecruitmentServiceImpl implements IRecruitmentService 
{
    @Autowired
    private RecruitmentMapper recruitmentMapper;

    /**
     * 查询招聘信息管理
     * 
     * @param recruitmentId 招聘信息管理ID
     * @return 招聘信息管理
     */
    @Override
    public Recruitment selectRecruitmentById(Long recruitmentId)
    {
        return recruitmentMapper.selectRecruitmentById(recruitmentId);
    }

    /**
     * 查询招聘信息管理列表
     * 
     * @param recruitment 招聘信息管理
     * @return 招聘信息管理
     */
    @Override
    public List<Recruitment> selectRecruitmentList(Recruitment recruitment)
    {
        return recruitmentMapper.selectRecruitmentList(recruitment);
    }

    /**
     * 新增招聘信息管理
     * 
     * @param recruitment 招聘信息管理
     * @return 结果
     */
    @Override
    public int insertRecruitment(Recruitment recruitment)
    {
        recruitment.setCreateTime(DateUtils.getNowDate());
        return recruitmentMapper.insertRecruitment(recruitment);
    }

    /**
     * 修改招聘信息管理
     * 
     * @param recruitment 招聘信息管理
     * @return 结果
     */
    @Override
    public int updateRecruitment(Recruitment recruitment)
    {
        recruitment.setUpdateTime(DateUtils.getNowDate());
        return recruitmentMapper.updateRecruitment(recruitment);
    }

    /**
     * 删除招聘信息管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteRecruitmentByIds(String ids)
    {
        return recruitmentMapper.deleteRecruitmentByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除招聘信息管理信息
     * 
     * @param recruitmentId 招聘信息管理ID
     * @return 结果
     */
    @Override
    public int deleteRecruitmentById(Long recruitmentId)
    {
        return recruitmentMapper.deleteRecruitmentById(recruitmentId);
    }
}
